package com.hyz.chajianhuahuanfu.chajianhua;

import android.content.Intent;
import android.os.Environment;
import android.view.View;
import android.widget.Toast;

import com.hyz.chajianhuahuanfu.R;

import java.io.File;

/**
 * Created by dp on 2018/4/26.
 */

public class MainActivity extends BaseSkinActivity {
    @Override
    protected void setContentView() {
        setContentView(R.layout.activity_main2);
    }

    public void skin(View view){
        // 从服务器上下载

        String SkinPath = Environment.getExternalStorageDirectory().getAbsolutePath()
                + File.separator +"red.skin";
        // 换肤
        int result = SkinManager.getInstance().loadSkin(SkinPath);
    }

    public void skin1(View view){
        // 恢复默认
        int result = SkinManager.getInstance().restoreDefault();
    }


    public void skin2(View view){
        // 跳转
        Intent intent = new Intent(this,MainActivity.class);
        startActivity(intent);
    }

    @Override
    public void changeSkin(SkinResource skinResource) {
        // 做一些第三方的改变
        Toast.makeText(this,"换肤了",Toast.LENGTH_SHORT).show();
    }
}
